Dynomotion

Group: DynoMotion Message: 6195 From: daveymahomh600e Date: 12/2/2012
Subject: fprintf File Contents
Hello Folks,

I have been working on a probing routine which is supposed to write points to a buffer which are then written to a text file.

First I tried to use a file name in a directory where I could remember the name and find it, but realized there must be some special considerations for it because I had compile errors doing it that way. I used the "FILE *f=fopen("C:\\temp\\kflopdata.txt","wt");" from the example file, but couldn't find the text file after the fact. I performed a search of the hard drive, but came up empty handed.

Could someone please tell me where I would find this file?

Thank you,
David.
Group: DynoMotion Message: 6197 From: Tom Kerekes Date: 12/2/2012
Subject: Re: fprintf File Contents
Hi David,

There are not any special considerations.  The file should be at:

C:\temp\kflopdata.txt

The C:\temp directory must already exist.

Regards
TK


Group: DynoMotion Message: 6198 From: David Stevenson Date: 12/2/2012
Subject: Re: fprintf File Contents

Thanks Tom.
 
Why would there be a compile error if I created a folder and even a file
that I wanted the data written to before hand?
 
David
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Sunday, December 02, 2012 6:05 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] fprintf File Contents

 

Hi David,

There are not any special considerations.  The file should be at:

C:\temp\kflopdata.txt

The C:\temp directory must already exist.

Regards
TK


Group: DynoMotion Message: 6200 From: Tom Kerekes Date: 12/2/2012
Subject: Re: fprintf File Contents
Hi David,

I don't know.  Please post the code that gives the compile error and what the error is.

Regards
TK


Group: DynoMotion Message: 6203 From: David Stevenson Date: 12/2/2012
Subject: Re: fprintf File Contents

Hi Tom,
 
The file line is...
 
    FILE *f=fopen("C:\KMotion429\RevolutionFiles\Probedata.txt","wt");
 
and the error is "invalid escaped char" ( I think it said invalid, but didn't write it down before I shut down the computer because I knew I wouldn't forget. lol)
 
Thanks,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Sunday, December 02, 2012 6:15 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] fprintf File Contents

 

Hi David,

I don't know.  Please post the code that gives the compile error and what the error is.

Regards
TK


Group: DynoMotion Message: 6204 From: Tom Kerekes Date: 12/2/2012
Subject: Re: fprintf File Contents
Hi David,

In the C language the backslash is a special "escape" character that allows you to enter non-printable characters by putting a backslash and then a special character.  For example \n is the "new line" character code.

This causes a problem when you really want a backslash.  So a double backslash is used to enter a slash.   See the double backslashes in the original example.

That probably was the compiler error message because your character sequence contains things like \K which is a valid escape character.

Regards
TK

Group: DynoMotion Message: 6205 From: David Stevenson Date: 12/2/2012
Subject: Re: fprintf File Contents

Hi Tom,
 
Well, now I get it. I couldn't figure out why there were double slashes in the example file. I thought there was missing info between them and that it was an abbreviation of sorts.
 
Thanks again,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Sunday, December 02, 2012 6:51 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] fprintf File Contents

 

Hi David,

In the C language the backslash is a special "escape" character that allows you to enter non-printable characters by putting a backslash and then a special character.  For example \n is the "new line" character code.

This causes a problem when you really want a backslash.  So a double backslash is used to enter a slash.   See the double backslashes in the original example.

That probably was the compiler error message because your character sequence contains things like \K which is a valid escape character.

Regards
TK